import React, { PureComponent } from 'react'

/**
 * state
 * props
 */

interface IProps {
  name: string
  age?: number
}

interface IState {
  counter: string
  message: string
}

class Template extends PureComponent<IProps, IState> {
  state = {
    counter: '123',
    message: 'hello world'
  }

  // componentDidUpdate(
  //   prevProps: Readonly<IProps>,
  //   prevState: Readonly<IState>,
  //   snapshot?: any
  // ): void {
  //   console.log('componentDidUpdate')
  // }

  render(): React.ReactNode {
    return (
      <div>
        <h1>{this.props.name}</h1>
        <h1>{this.props.age}</h1>
        <h1>{this.state.counter}</h1>
        <h1>{this.state.message}</h1>
      </div>
    )
  }
}

export default Template
